-
-
Notifications
You must be signed in to change notification settings - Fork 932
Send GeoJSON data from worker to main if loaded from a URL #6811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6811 +/- ##
=======================================
Coverage 92.42% 92.42%
=======================================
Files 288 288
Lines 23807 23809 +2
Branches 5056 5058 +2
=======================================
+ Hits 22003 22005 +2
Misses 1804 1804 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
How about fetching it in the main thread instead of serializing it from the worker? |
|
There's no way to guarantee the browser will cache the response. If the response has a |
|
Does it make sense now to return the data in |
As we discussed in #6738, there are still cases where
I think it's worth having this method around for backwards compatibility. (Sidenote: If and when we're ready to make some breaking changes, I'd love to see |
|
If you have ideas for breaking changes please add them to the following issue: |
Summary
Part of #4364
This PR carves out an exception from the optimization added in #6668. When GeoJSON data is loaded from a URL, we now send it back to the main thread so that it can be:
map.getStyle()GeoJSONSource#_getShouldReloadTileOptionsfor fasterGeoJSONSource#updateDataoperations (ref Use only bounds for geojson diff tile reload #6800)queryRenderedFeaturesto return original feature properties (ref fix: Don't serialize GeoJSON vector tiles from the worker to support undefined properties #6803)When GeoJSON is provided inline or via diff updates, the main thread already has the data, so we skip sending it back (preserving the #6668 optimization).
This will make
GeoJSONSource#updateDatamuch faster when the GeoJSON data was loaded from a URL.Benchmarks
Launch Checklist
CHANGELOG.mdunder the## mainsection.